package com.Maykk.Demo04;

/**
 * @ClassName: DemoTest
 * @Description: TODO 枚举类的常用方法
 * @Author: MaykkStar@163.com
 */
public class DemoTest {
    public static void main(String[] args) {
        System.out.println(Direction.UP);
        System.out.println(Direction.DOWN);
        System.out.println(Direction.LEFT);
        System.out.println(Direction.RIGHT);
        System.out.println("''''''''''''''''");

        Direction up = Direction.valueOf("UP");
        System.out.println(
                up.name() + " ==> " +
                        up.getData() + " : " +
                        up.getDirInfo()
        );
        System.out.println("‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’");
        System.out.println(up.name()); // 枚举类名称
        System.out.println(Direction.UP.ordinal()); // 枚举编号
        System.out.println(Direction.LEFT.ordinal()); // 枚举编号
        System.out.println(Direction.DOWN.ordinal()); // 枚举编号
        System.out.println(Direction.RIGHT.ordinal()); // 枚举编号
    }
}
